import request from "@/utils/request";

const hosUrl = "/admin/hosp/hospital";
const cmntUrl = "/admin/cmn/dict";
const departUrl = "/admin/hosp/department";

export default {
  //医院列表
  getPageList(current, limit, searchObj) {
    return request({
      url: `${hosUrl}/findPage/${current}/${limit}`,
      method: "post",
      data: searchObj
    });
  },
  //查询dictCode查询下级数据字典
  findByDictCode(dictCode) {
    return request({
      url: `${cmntUrl}/findByDictCode/${dictCode}`,
      method: "get"
    });
  },

  //根据id查询下级数据字典
  findByParentId(dictCode) {
    return request({
      url: `${cmntUrl}/findChildData/${dictCode}`,
      method: "get"
    });
  },

  //更新医院上线状态
  updateStatus(id, status) {
    return request({
      url: `${hosUrl}/updateStatus/${id}/${status}`,
      method: "get"
    });
  },

  //查看医院详情
  getHospById(id) {
    return request({
      url: `${hosUrl}/show/${id}`,
      method: "get"
    });
  },

  //查看医院科室
  getDeptByHoscode(hoscode) {
    return request({
      url: `${departUrl}/getDeptList/${hoscode}`,
      method: "get"
    });
  }
};
